package com.example.day06;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String[] strings={"一","二","三","四"};
        String[] iconNames={"p1","p2","p3"};
        Map<String, List<String>> map = new HashMap();
        ArrayList<String> arr1 = new ArrayList<>();
        arr1.add("111111111111111111111111");
        arr1.add("222222222222222222");
        arr1.add("333333333333333333333");
        ArrayList<String> arr2 = new ArrayList<>();
        arr2.add("AAAAAAAAAAAAAAA");
        arr2.add("BBBBBBBBBBBBBBBBBBBBBBBBBB");
        arr2.add("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC");
        ArrayList<String> arr3 = new ArrayList<>();
        arr3.add("```````````````````````````");
        arr3.add("!!!!!!!!!!!!!!!!!!!!!!!!");
        arr3.add("小");
        ArrayList<String> arr4 = new ArrayList<>();
        arr4.add("```````````````````````````");
        arr4.add("!!!!!!!!!!!!!!!!!!!!!!!!");
        arr4.add("小");
        map.put(strings[0],arr1);
        map.put(strings[1],arr2);
        map.put(strings[2],arr3);
        map.put(strings[3],arr4);
        ExpandableListViewTest expandableListViewTest = new ExpandableListViewTest(strings,map,this,iconNames);
        ExpandableListView elv = findViewById(R.id.elv);
        elv.setAdapter(expandableListViewTest);
    }
}